package bairui.international.console.web.controller.branch.branch.staff;

/**
 * @see bairui.international.console.web.controller.branch.branch.staff.AddPage_BaseFilter
 *
 */
class AddPage_Filter

{
	
	/**
	 * 过滤扩展接口
	 */
	static interface FilterExtends {
	}
	
	final static com.querydsl.core.BooleanBuilder query(
		bairui.international.model.domain.jpa.QTB_User QRoot,
		javax.servlet.http.HttpServletRequest request
	) {
		com.querydsl.core.BooleanBuilder query = query(
				QRoot
	,			com.sh_lianjing.string.util.Util_String.parseToType(
						request.getParameter("nickName"), 
						String.class, 
						"yyyy-MM-dd"
					)
	,			com.sh_lianjing.string.util.Util_String.parseToType(
						request.getParameter("realName"), 
						String.class, 
						"yyyy-MM-dd"
					)
	,			com.sh_lianjing.string.util.Util_String.parseToType(
						request.getParameter("phone"), 
						String.class, 
						"yyyy-MM-dd"
					)
	,			com.sh_lianjing.string.util.Util_String.parseToType(
						request.getParameter("company"), 
						String.class, 
						"yyyy-MM-dd"
					)
	,			com.sh_lianjing.string.util.Util_String.parseToType(
						request.getParameter("type"), 
						bairui.international.model.type.Type_User.class, 
						"yyyy-MM-dd"
					)
	,			com.sh_lianjing.string.util.Util_String.parseToType(
						request.getParameter("state"), 
						bairui.international.model.status.State_User.class, 
						"yyyy-MM-dd"
					)
	,			com.sh_lianjing.string.util.Util_String.parseToType(
						request.getParameter("createTime_start"), 
						java.util.Date.class, 
						"yyyy-MM-dd"
					),
				com.sh_lianjing.string.util.Util_String.parseToType(
						request.getParameter("createTime_end"), 
						java.util.Date.class, 
						"yyyy-MM-dd"
					)
			);
			/* comment 附加过滤属性 */
	;
		return query;
	}
	
	final static com.querydsl.core.BooleanBuilder query(
		bairui.international.model.domain.jpa.QTB_User QRoot
	,	String nickName
	,	String realName
	,	String phone
	,	String company
	,	bairui.international.model.type.Type_User type
	,	bairui.international.model.status.State_User state
	,	java.util.Date createTime_start,
		java.util.Date createTime_end
	) {
		com.querydsl.core.BooleanBuilder builder = new com.querydsl.core.BooleanBuilder();
	
		if(null != nickName){
			builder.and(QRoot.nickName.like("%"+nickName+"%"));
		}
		if(null != realName){
			builder.and(QRoot.realName.like("%"+realName+"%"));
		}
		if(null != phone){
			builder.and(QRoot.phone.like("%"+phone+"%"));
		}
		if(null != company){
			builder.and(QRoot.company.like("%"+company+"%"));
		}
		if(null != type){
			builder.and(QRoot.type.eq(type));
		}
		if(null != state){
			builder.and(QRoot.state.eq(state));
		}
		if(null != createTime_start && null != createTime_end){
			builder.and(QRoot.createTime.between(createTime_start, createTime_end));
		}
		return builder;
	}
	
}
